<template>
	<view>
		<view class="list" v-for="(item,key) in orders" :key="key">
			<view class="list-head">
				<view class="">
					<view class="text blod">{{item.name}}</view>
					<view class="text">{{item.buy_time}}</view>
					
				</view>
				<view style="color:#FF7465;">{{item.status}}</view>
			</view>
			<view class="list-item">
				<view class="item">
					<view class="title">
						购买门店
					</view>
					<view class="content">
						<view class="text">
							{{item.shop_name}}
						</view>
						<view class="text">
							{{item.address}}
						</view>
					</view>
				</view>
				<view class="item">
					<view class="title">
						包含服务
					</view>
					<view class="content">
						<view class="text">
							{{item.service_name}}
						</view>
					</view>
				</view>
			</view>
			<view class="list-foot">
				<image src="../../../static/phonecall.png" mode="" class="phonecall" @click="phonecall(item.phone)"></image>
				<view class="text blod">
					订单总价：￥{{item.total_price}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orders:[],
			};
		},
		onLoad:function(){
			this.getOrderList();
		},
		methods:{
			phonecall:function(phone){
				uni.makePhoneCall({
					phoneNumber:phone
				})
			},
			showOrderDetail:function(id){
				uni.navigateTo({
					url:"/pages/order/card/card?id="+id
				})
			},
			
			switchStatus:function(status){
				this.status=status;
				this.getOrderList();
			},
			getOrderList:function(){
				uni.showLoading({
					title:"加载中"
				});
				var that = this;
				that.ajax("/order/cards",{
					token:uni.getStorageSync("token"),
				},function(res){
					that.orders=res.data.data;
				});
			}
		}
	}
</script>

<style>
	page{
		background: #f7f7f7;
	}
	.image{
		width: 25upx;
		height: 25upx;
		margin-right: 10upx;
	}
	.text{
		font-size: 28upx;
		color:#4B4B4B;
		margin-left: 24upx;
	}
	.blod{
		font-weight: 600;
	}
	.list-head{
		font-size: 24upx;
		color: #272727;
		padding: 20upx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}
	.order-list{
		
		display: flex;
		flex-direction: row;
		align-items: center;
		padding: 20upx;
	}
	.order-tab-active{
		margin-right: 20upx;
		color:#3d3e46;
		background: #ffe55c;
		padding: 6upx 30upx;
		border-radius: 30upx;
		white-space: nowrap;
	}
	.order-tab{
		margin-right: 20upx;
		color: #bbbbbb;
		padding: 14upx 30upx;
		white-space: nowrap;
	}
	.nostyle{
		margin: 0;
		padding: 0;
		background: none;
		border:none;
	}
	.nostyle:after{
		border:none;
	}
	.order-scroll{
		background: #f5f5f5;
	}
	.list{
		margin: 32upx 16upx 0 16upx;
		background: #ffffff;
		padding: 0 20upx;
		box-shadow:0upx 2upx 20upx 0upx rgba(43,159,133,0.14);
		border-radius: 12upx;
	}
	.list-head{
		padding: 20upx 0;
		display: flex;
		flex-direction: row;
		align-items: center;
		border-bottom: 1upx dotted #DDDDDD;
		position: relative;
	}
	.list-head:before{
		content: '';
		width: 16upx;
		height: 26upx;
		background: #F2F2F2;
		border-top-right-radius: 13upx;
		border-bottom-right-radius: 13upx;
		position: absolute;
		bottom: -13upx;
		left: -20upx;
	}
	.list-head:after{
		content: '';
		position: absolute;
		width: 16upx;
		height: 26upx;
		background: #F2F2F2;
		border-top-left-radius: 13upx;
		border-bottom-left-radius: 13upx;
		bottom: -13upx;
		right: -20upx;
	}
	.list-title{
		flex: 1;
		font-size: 30upx;
	}
	.list-total{
		font-size: 24upx;
		color: #b6b6b6;
	}
	.list-item{
		padding: 20upx 0;
		position: relative;
	}
	.item-image{
		width: 260upx;
		height: 210upx;
		border-radius: 10upx;
		margin-right: 20upx;
	}
	.item-info{
		flex: 1;
	}
	.item-title{
		font-size: 25upx;
		display: flex;
		flex-direction: row;
	}
	.item-cart{
		flex: 1;
		display: flex;
		flex-direction: row;
		align-content: flex-end;
		align-items: flex-end;
	}
	.weight{
		font-size: 16upx;
		line-height: 30upx;
		background: #e5e5e5;
		border-radius: 6upx;
		display: inline-block;
		padding: 0 10upx;
		color: #ffffff;
	}
	.item-bottom{
		display: flex;
		flex-direction: row;
		align-items: center;
		height: 85upx;
		font-size: 25upx;
	}
	.item-price{
		flex: 1;
		font-size: 24upx;
		color: #ff340e;
		font-weight: 600;
	}
	.item-count{
		flex: 1;
		text-align: right;
		font-size: 22upx;
		color: #bcbcbc;
	}
	
	.preview{
		margin:20upx;
		padding: 30upx;
		background: #ffffff;
		border-radius: 15upx;
		position: relative;
	}
	.item{
		margin-bottom: 20upx;
		display: flex;
		flex-direction: row;
		align-items: center;
		box-shadow:0upx 2upx 20upx 0upx rgba(43,159,133,0.14);
		border-radius:12upx 0upx 0upx 12upx;
		padding: 24upx 16upx;
	}
	.item:last-child{
		margin-bottom: 0;
	}
	.title{
		color: #ffffff;
		font-size: 24upx;
		background: #45AA8C;
		border-radius: 8upx;
		padding: 6upx 10upx;
	}
	.content{
		display: flex;
		flex-direction: column;
	}
	.list-foot{
		border-top: 1upx dotted #DDDDDD;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		padding: 30upx 0;
		position: relative;
	}
	.list-foot:before{
		content: '';
		width: 16upx;
		height: 26upx;
		background: #F2F2F2;
		border-top-right-radius: 13upx;
		border-bottom-right-radius: 13upx;
		position: absolute;
		top: -13upx;
		left: -20upx;
	}
	.list-foot:after{
		content: '';
		position: absolute;
		width: 16upx;
		height: 26upx;
		background: #F2F2F2;
		border-top-left-radius: 13upx;
		border-bottom-left-radius: 13upx;
		top: -13upx;
		right: -20upx;
	}
	.phonecall{
		top:30upx;
		right: 0;
		width: 45upx;
		height: 45upx;
	}
</style>
